class LogType {
  static const String infoAll = '-1';
  static const String apiResponse = '1';
  static const String info = '2';
  static const String error = '4';
  static const String promiseError = '8';
  static const String ajaxError = '16';
  static const String scriptError = '32';
  static const String imageError = '64';
  static const String cssError = '128';
  static const String consoleError = '256';
  static const String mediaError = '512';
  static const String retError = '1024';
  static const String report = '2048';
}

/// 平台类型
enum PlatTypeNum {
  unknown,
  android,
  ios,
  windows,
  macos,
  linux,
  devtools,
  other,
}

/// 网络类型
class NetworkType {
  static int unknown = 100;
  static int wifi = 1;
  static int net2g = 2;
  static int net3g = 3;
  static int net4g = 4;
  static int net5g = 5;
  static int net6g = 6;
}

/// 本地日志类型
class debugLogType {
  static String critical = 'AEGIS_CRITICAL';
  static String sendError = 'AEGIS_SEND_ERROR';
  static String pagePerformance = 'AEGIS_PAGE_PERFORMANCE';
}

/// 日志类型
class NormalLog {
  NormalLog(
      {required this.msg,
      required this.level,
      String? ext1,
      String? ext2,
      String? ext3});

  dynamic msg;
  String level;
  String? ext1;
  String? ext2;
  String? ext3;

  Map toJson() => {
        'msg': msg,
        'level': level,
        'ext1': ext1,
        'ext2': ext2,
        'ext3': ext3,
      };
}

class EventLog {
  EventLog({
    required this.name,
    this.ext1,
    this.ext2,
    this.ext3,
    this.from,
  });
  String name;
  String? ext1;
  String? ext2;
  String? ext3;
  String? from;

  Map toJson() => {
        'name': name,
        'ext1': ext1 ?? '',
        'ext2': ext2 ?? '',
        'ext3': ext3 ?? '',
        'from': from ?? '',
      };
}

class ReportTimeLog {
  ReportTimeLog({
    required this.name,
    required this.duration,
    this.ext1,
    this.ext2,
    this.ext3,
    this.from,
  });
  String name;
  int duration;
  String? ext1;
  String? ext2;
  String? ext3;
  String? from;
  Map toJson() => {
        'name': name,
        'duration': duration,
        'ext1': ext1 ?? '',
        'ext2': ext2 ?? '',
        'ext3': ext3 ?? '',
        'from': from ?? '',
      };
}
